/*
 * Copyright (C) 2010-2011 Graz University of Technology, Austria. All Rights reserved. 
 *
 * Contact: Simone Kopeinik <simone.kopeinik@tugraz.at>
 * 	   Graz University of Technology, Knowledge Management Institute, Brückenkopfgasse 1/6, 8020 Graz 	
 * 	   <http://www.kmi.tugraz.at/>
 * 
 * This software is part of the TARGET platform developed by the
 * TARGET EC-funded project www.reachyourtarget.org
 *
 * This software is free software: you can redistribute it and/or modify
 * it under the terms of the GNU General Public License as published by
 * the Free Software Foundation, version 3.
 *
 * This software is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
 * GNU General Public License for more details.
 *
 * The GNU General Public License is available at <http://www.gnu.org/licenses/>.
 *
 */
package at.tugraz.kmi.css.cbkst2.prereq.examples;

import java.util.ServiceLoader;

import javax.swing.JFrame;
import javax.swing.WindowConstants;

import at.tugraz.kmi.css.cbkst2.prereq.structurevis.CompetenceManagerView;

import com.google.inject.Guice;
import com.google.inject.Provider;

/**
 * Example that shows how to use the PrerequesiteOrdereSet Visualisation. This
 * example is automatically (content between START SNIPPET) included in the
 * documentation.
 * 
 * @author Georg Öttl
 * 
 */
public class ReuseVis {

	// START SNIPPET: CA
	public static void main(String[] args) {
		// Loads the default guice configuration with the ServiceLocator
		// pattern. Available only on JDK >= 1.6
		Provider<CompetenceManagerView> provider = Guice.createInjector(
				ServiceLoader.load(com.google.inject.Module.class))
				.getProvider(CompetenceManagerView.class);
		// Get a new instance of the view.
		CompetenceManagerView viewer = provider.get();
		// Display the instance in a newly created frame
		JFrame frame = new JFrame();
		frame.getContentPane().add(viewer);
		frame.setDefaultCloseOperation(WindowConstants.DISPOSE_ON_CLOSE);
		frame.pack();
		frame.setVisible(true);
	}
	// END SNIPPET: CA

}
